package com.damei.hospital_android.utils;

import com.alibaba.fastjson.JSON;

import java.util.Map;

public class Utils {

    public static <T> T mapToObj(Map source, Class<T> target) {
        try {
            T result = JSON.parseObject(JSON.toJSONString(source), target);
            return result;
        }catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
